import java.util.Random;

public class Lab_02calculation_V01 {
    public static void main(String[] args) {
        Random rand = new Random();
        for (int i = 0; i < 50; i++) {
            int num1 = rand.nextInt(100); // 生成0到99之间的随机数
            int num2 = rand.nextInt(100);
            String operator = rand.nextBoolean() ? "+" : "-"; // 随机选择加法或减法
            int result = operator.equals("+") ? num1 + num2 : num1 - num2;

            System.out.println("题目" + (i + 1) + ": " + num1 + " " + operator + " " + num2 + " = " + result);
        }
    }
}
